package dav.mobile.garuda.states.game.objects.encounters;

import com.badlogic.gdx.math.Vector2;

import dav.mobile.garuda.states.game.GameObject;
import dav.mobile.garuda.states.game.objects.Garuda;

//Encounter abstract class for enemy
public abstract class Encounter extends GameObject {
	//constant for color
	public static final int COLOR_BLUE = 0;
	public static final int COLOR_GREEN = 1;
	public static final int COLOR_YELLOW = 2;
	public static final int COLOR_RED = 3;
	
	//Attributes
	protected int 		m_Color; 
	protected Vector2 	m_Force;
	protected boolean 	m_Hitted;
	
	//Default constructor, REMEMBER TO SET TEXTURE REGION IN CHILDS
	protected Encounter(int x, int y, int color, Vector2 force) {
		//Super
		super(x, y);
		
		//Set texture to null
		m_Texture = null;
		
		//Set color
		m_Color = color;
		
		//Set force
		m_Force = force;
		
		//Set hit flag
		m_Hitted = false;
	}

	//Hit function
	public void Hit(Garuda garuda) {
		//Play sound
		PlaySound();
		
		//apply encounter force to garuda
		garuda.getPhysicsBody().applyForce(m_Force, garuda.getPhysicsBody().getPosition());
		
		//Set flag to true
		m_Hitted=true;
	}
	
	//Abstract for checking outer bounds
	public abstract boolean DoesAABBOuterHit(Garuda garuda);

	//Abstract for playing encounter sound
	protected abstract void PlaySound();
	
	//Getter
	public boolean HasHitten() { return m_Hitted; }
}
